package com.chinasi.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.caland.framework.core.page.Pager;
import com.chinasi.dao.IndustryInfoDao;
import com.chinasi.model.BidBasic;
import com.chinasi.model.IndustryInfo;
import com.chinasi.service.IndustryInfoService;

@Service
public class IndustryInfoServiceImpl implements IndustryInfoService {

	/**
	 * IndustryInfoDAO
	 */
	@Autowired
	private IndustryInfoDao industryInfoDao;

	@Override
	public Pager findPageCondition(IndustryInfo searchBean, int currentPage) {
		Pager pager = new Pager(industryInfoDao.getTotalCount(searchBean),currentPage);
		pager.setPageSize(8);
		if(pager.getCurrentPage() >= currentPage)
			pager.setData(industryInfoDao.findByCondition(searchBean, pager.getStartRow(), pager.getPageSize()));
		return pager;
	}

	@Override
	public IndustryInfo findById(String id) {
		return industryInfoDao.findByPK(id, IndustryInfo.class);
	}
	
}
